|
| Contents | |
| About This Extension |
Unlike the getChannelMute, getChannelSolo, getTrackMute, getTrackSolo, setChannelMute, setChannelSolo, setTrackMute, and setTrackSolo methods provided by the core Music Object API that only allow one to test and affect the state of one channel or track at a time, the additional methods in this extension allow one to test and affect the state of multiple channels or tracks in a single operation.
Consider the following before-and-after example. Using the core Music Object API's setTrackMute method, it takes a chunk of code to mute 8 tracks. However, using the setTracksMute method provided in this extension, the same code can be neatly folded into a single statement - nice and clean.
| BEFORE (Using setTrackMute) |
myMusicObject.setTrackMute (1,true); myMusicObject.setTrackMute (7,true); myMusicObject.setTrackMute (15,true); myMusicObject.setTrackMute (24,true); myMusicObject.setTrackMute (42,true); myMusicObject.setTrackMute (43,true); myMusicObject.setTrackMute (47,true); myMusicObject.setTrackMute (59,true); |
| AFTER (Using setTracksMute) |
myMusicObject.setTracksMute ('1,7,15,24,42,43,47,59',true);
|
The methods provided by this extension make it easier to program Web-based "remix" interfaces, where musical compositions are "performed" as the user switches on and switches off different parts of the music - these parts often being made up of multiple channels or tracks.
| What's New in the Latest Version |
There is a dedicated version history for this extension, where you will be able to find out about the new features and possible issues with the most recent version. The version history for this extension is independent of the version history for the core Music Object API.
| Getting This Extension |
To get the "music-object-x-groups.js" JavaScript file that implements this extension, simply right-click on this link (click-and-hold for Mac users). Then, from the menu that pops up, select the 'Save Link As...' or 'Save Target As...' option and save the file as "music-object-x-groups.js" into an appropriate folder of the local copy of your Web site.
In case you have problems saving the file using the above link, the "music-object-x-groups.js" file can also be found inside the documentation's "javascript" folder, along with the "music-object.js" file.
| Dependencies |
In order to use this extension, the following JavaScript file(s) must first be sourced in...
For more information on using extensions, consult the section About Music Object Extensions.
| Reference |
| |||||||||||||||||||||
| Instance Methods |
| getChannelsMute |
|
The getChannelsMute method determines the overall channel mute state for multiple channels in one simple step.
| getChannelsMute ( MidiChannelGroupSTR ) |
| MuteStateBOOL |
The getChannelsMute method returns a boolean value representing the overall mute state of the specified channel group. If all channels in the specified group are muted, then the group is regarded as being muted and the getChannelsMute method returns a value of true. However, if any or all of the channels in the group are not muted, then the group is not regarded as being muted and a value of false is returned. It is possible to toggle the mute state of a channel group with a statement such as...
myMusicObject.setChannelsMute ('1,4,7,15',!myMusicObject.getChannelsMute ('1,4,7,15'));
|
This is not the same as the statement myMusicObject.setChannelsMute ('1,4,7,15','Toggle'), since the Toggle value will have the effect of toggling the mute states of each of the individual channels that make up the group, thereby "inverting" the mute state of the group. It is, however, equivalent to the statement myMusicObject.setChannelsMute ('1,4,7,15','Toggle Group'), since using the Toggle Group value results in the setChannelsMute method first determining the mute state of the group as a whole, and then setting all the specified channels to the opposite state.
When the MidiChannel0to16 parameter is used in place of the MidiChannelGroupSTR parameter, then the getChannelsMute method can be used in just the same way as the getChannelMute method, making the getChannelsMute method more versatile, because you could pass it a parameter that is a Number representing a single MIDI channel, or a String representing a group of MIDI channels.
| getChannelsSolo |
|
The getChannelsSolo method determines the overall channel solo state for multiple channels in one simple step.
| getChannelsSolo ( MidiChannelGroupSTR ) |
| SoloStateBOOL |
The getChannelsSolo method returns a boolean value representing the overall solo state of the specified channel group. If all channels in the specified group are soloed, then the group is regarded as being soloed and the getChannelsSolo method returns a value of true. However, if any or all of the channels in the group are not soloed, then the group is not regarded as being soloed and a value of false is returned. It is possible to toggle the solo state of a channel group with a statement such as...
myMusicObject.setChannelsSolo ('1,4,7,15',!myMusicObject.getChannelsSolo ('1,4,7,15'));
|
This is not the same as the statement myMusicObject.setChannelsSolo ('1,4,7,15','Toggle'), since the Toggle value will have the effect of toggling the solo states of each of the individual channels that make up the group, thereby "inverting" the solo state of the group. It is, however, equivalent to the statement myMusicObject.setChannelsSolo ('1,4,7,15','Toggle Group'), since using the Toggle Group value results in the setChannelsSolo method first determining the solo state of the group as a whole, and then setting all the specified channels to the opposite state.
When the MidiChannel0to16 parameter is used in place of the MidiChannelGroupSTR parameter, then the getChannelsSolo method can be used in just the same way as the getChannelSolo method, making the getChannelsSolo method more versatile, because you could pass it a parameter that is a Number representing a single MIDI channel, or a String representing a group of MIDI channels.
| getTracksMute |
|
The getTracksMute method determines the overall track mute state for multiple tracks in one simple step.
| getTracksMute ( TrackGroupSTR ) |
| MuteStateBOOL |
The getTracksMute method returns a boolean value representing the overall mute state of the specified track group. If all tracks in the specified group are muted, then the group is regarded as being muted and the getTracksMute method returns a value of true. However, if any or all of the tracks in the group are not muted, then the group is not regarded as being muted and a value of false is returned. It is possible to toggle the mute state of a track group with a statement such as...
myMusicObject.setTracksMute ('3,12,18,19,27',!myMusicObject.getTracksMute ('3,12,18,19,27'));
|
This is not the same as the statement myMusicObject.setTracksMute ('3,12,18,19,27','Toggle'), since the Toggle value will have the effect of toggling the mute states of each of the individual tracks that make up the group, thereby "inverting" the mute state of the group. It is, however, equivalent to the statement myMusicObject.setTracksMute ('3,12,18,19,27','Toggle Group'), since using the Toggle Group value results in the setTracksMute method first determining the mute state of the group as a whole, and then setting all the specified tracks to the opposite state.
When the TrackNumber0to64 parameter is used in place of the TrackGroupSTR parameter, then the getTracksMute method can be used in just the same way as the getTrackMute method, making the getTracksMute method more versatile, because you could pass it a parameter that is a Number representing a single track, or a String representing a group of tracks.
| getTracksSolo |
|
The getTracksSolo method determines the overall track solo state for multiple tracks in one simple step.
| getTracksSolo ( TrackGroupSTR ) |
| SoloStateBOOL |
The getTracksSolo method returns a boolean value representing the overall solo state of the specified track group. If all tracks in the specified group are soloed, then the group is regarded as being soloed and the getTracksSolo method returns a value of true. However, if any or all of the tracks in the group are not soloed, then the group is not regarded as being soloed and a value of false is returned. It is possible to toggle the solo state of a track group with a statement such as...
myMusicObject.setTracksSolo ('3,12,18,19,27',!myMusicObject.getTracksSolo ('3,12,18,19,27'));
|
This is not the same as the statement myMusicObject.setTracksSolo ('3,12,18,19,27','Toggle'), since the Toggle value will have the effect of toggling the solo states of each of the individual tracks that make up the group, thereby "inverting" the solo state of the group. It is, however, equivalent to the statement myMusicObject.setTracksSolo ('3,12,18,19,27','Toggle Group'), since using the Toggle Group value results in the setTracksSolo method first determining the solo state of the group as a whole, and then setting all the specified tracks to the opposite state.
When the TrackNumber0to64 parameter is used in place of the TrackGroupSTR parameter, then the getTracksSolo method can be used in just the same way as the getTrackSolo method, making the getTracksSolo method more versatile, because you could pass it a parameter that is a Number representing a single track, or a String representing a group of tracks.
| setChannelsMute |
|
The setChannelsMute method lets you set the channel mute state for multiple channels in one simple step.
| setChannelsMute ( MidiChannelGroupSTR , MuteStateBOOL ) |
The setChannelsMute method lets you set the mute state of multiple MIDI channels in one simple step. This lets you treat multiple MIDI channels together as a group. This is quite useful, among other things, for coding Web-based "remix" interfaces. A MIDI channel group is specified as a string value, containing a comma-separated list of MIDI channel numbers, as in
By using one of its variations, the setChannelsMute method also lets you use a convenient Toggle value to automatically invert the mute states of all channels in a group, as in
One can also use the Toggle Group value to automatically toggle the mute state of the group as a whole, as in
When a value of true is specified for the optional ExclusiveBOOL parameter, then all channels other than those specified in the MidiChannelGroupSTR parameter will be set to the opposite state of the channels in the group. So, the statement
When the MuteStateSTR parameter is used in place of the MuteStateBOOL parameter, it becomes possible to make use of the convenient Toggle value, which makes it easy to toggle the mute states of each channel in a group in one simple step, as in the statement
When the MidiChannel0to16 parameter is used in place of the MidiChannelGroupSTR parameter, then the setChannelsMute method can be used to affect the state of a single channel in the same way as the setChannelMute method. So, the setChannelsMute method is more versatile, because you could pass it a parameter that is a Number representing a single MIDI channel, or a String representing a group of MIDI channels. This also makes the convenient Toggle value available when simply affecting the state of one MIDI channel, as in
When no MuteStateBOOL or MuteStateSTR parameter is specified, then the setChannelsMute method will mute all the channels in the specified MIDI channel group. So, the statement
| setChannelsSolo |
|
The setChannelsSolo method lets you set the channel solo state for multiple channels in one simple step.
| setChannelsSolo ( MidiChannelGroupSTR , SoloStateBOOL ) |
The setChannelsSolo method lets you set the solo state of multiple MIDI channels in one simple step. This lets you treat multiple MIDI channels together as a group. This is quite useful, among other things, for coding Web-based "remix" interfaces. A MIDI channel group is specified as a string value, containing a comma-separated list of MIDI channel numbers, as in
By using one of its variations, the setChannelsSolo method also lets you use a convenient Toggle value to automatically invert the solo states of all channels in a group, as in
One can also use the Toggle Group value to automatically toggle the solo state of the group as a whole, as in
When a value of true is specified for the optional ExclusiveBOOL parameter, then all channels other than those specified in the MidiChannelGroupSTR parameter will be set to the opposite state of the channels in the group. So, the statement
When the SoloStateSTR parameter is used in place of the SoloStateBOOL parameter, it becomes possible to make use of the convenient Toggle value, which makes it easy to toggle the solo states of each channel in a group in one simple step, as in the statement
When the MidiChannel0to16 parameter is used in place of the MidiChannelGroupSTR parameter, then the setChannelsSolo method can be used to affect the state of a single channel in the same way as the setChannelSolo method. So, the setChannelsSolo method is more versatile, because you could pass it a parameter that is a Number representing a single MIDI channel, or a String representing a group of MIDI channels. This also makes the convenient Toggle value available when simply affecting the state of one MIDI channel, as in
When no SoloStateBOOL or SoloStateSTR parameter is specified, then the setChannelsSolo method will solo all the channels in the specified MIDI channel group. So, the statement
| setTracksMute |
|
The setTracksMute method lets you set the track mute state for multiple tracks in one simple step.
| setTracksMute ( TrackGroupSTR , MuteStateBOOL ) |
The setTracksMute method lets you set the mute state of multiple tracks in one simple step. This lets you treat multiple tracks together as a group. This is quite useful, among other things, for coding Web-based "remix" interfaces. A track group is specified as a string value, containing a comma-separated list of track numbers, as in
By using one of its variations, the setTracksMute method also lets you use a convenient Toggle value to automatically invert the mute states of all tracks in a group, as in
One can also use the Toggle Group value to automatically toggle the mute state of the group as a whole, as in
When a value of true is specified for the optional ExclusiveBOOL parameter, then all tracks other than those specified in the TrackGroupSTR parameter will be set to the opposite state of the tracks in the group. So, the statement
When the MuteStateSTR parameter is used in place of the MuteStateBOOL parameter, it becomes possible to make use of the convenient Toggle value, which makes it easy to toggle the mute states of each track in a group in one simple step, as in the statement
When the TrackNumber0to64 parameter is used in place of the TrackGroupSTR parameter, then the setTracksMute method can be used to affect the state of a single track in the same way as the setTrackMute method. So, the setTracksMute method is more versatile, because you could pass it a parameter that is a Number representing a single track, or a String representing a group of tracks. This also makes the convenient Toggle value available when simply affecting the state of one track, as in
When no MuteStateBOOL or MuteStateSTR parameter is specified, then the setTracksMute method will mute all the tracks in the specified track group. So, the statement
| setTracksSolo |
|
The setTracksSolo method lets you set the track solo state for multiple tracks in one simple step.
| setTracksSolo ( TrackGroupSTR , SoloStateBOOL ) |
The setTracksSolo method lets you set the solo state of multiple tracks in one simple step. This lets you treat multiple tracks together as a group. This is quite useful, among other things, for coding Web-based "remix" interfaces. A track group is specified as a string value, containing a comma-separated list of track numbers, as in
By using one of its variations, the setTracksSolo method also lets you use a convenient Toggle value to automatically invert the solo states of all tracks in a group, as in
One can also use the Toggle Group value to automatically toggle the solo state of the group as a whole, as in
When a value of true is specified for the optional ExclusiveBOOL parameter, then all tracks other than those specified in the TrackGroupSTR parameter will be set to the opposite state of the tracks in the group. So, the statement
When the SoloStateSTR parameter is used in place of the SoloStateBOOL parameter, it becomes possible to make use of the convenient Toggle value, which makes it easy to toggle the solo states of each track in a group in one simple step, as in the statement
When the TrackNumber0to64 parameter is used in place of the TrackGroupSTR parameter, then the setTracksSolo method can be used to affect the state of a single track in the same way as the setTrackSolo method. So, the setTracksSolo method is more versatile, because you could pass it a parameter that is a Number representing a single track, or a String representing a group of tracks. This also makes the convenient Toggle value available when simply affecting the state of one track, as in
When no SoloStateBOOL or SoloStateSTR parameter is specified, then the setTracksSolo method will solo all the tracks in the specified track group. So, the statement